#!/usr/bin/env bash

SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)
pushd "${SCRIPT_DIR}/dist"

DLLS=( ntdll kernelbase kernel32 crypt32 skf )

for DLLNAME in ${DLLS[@]}; do
    pushd "dlls/${DLLNAME}" || continue
    make || exit 1
    popd
done

for DLLNAME in ${DLLS[@]}; do
    pushd "dlls/${DLLNAME}"
    sudo make install || exit 1
    popd
done

popd
